home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1282 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: news.compuserve.com!newsmaster
  2. From: <75151.03563@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: VC++ alpha list box implementation question
  5. Date: 10 Jan 1996 08:33:40 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4cvtl4$7g9@dub-news-svc-3.compuserve.com>
  8. NNTP-Posting-Host: dd74-136.compuserve.com
  9. Content-Type: text/plain
  10. Content-length: 1543
  11. X-Newsreader: AIR Mosaic (16-bit) version 1.00.198.07
  12.  
  13.  
  14.  mark@mivax.mc.duke.edu (MARK) writes:
  15. >Using VC++ one can click on the menu selection for "Help", select
  16. >the "C/C++ Language" from the subsequent list of help choices and then be
  17. >presented with a "Search" window.  As a character is typed into an edit
  18. >box, a corresponding list box is filled with an alphabetically sorted list
  19. >of potential topics of interest.  The list is further refined with each
  20. >additional character typed into the edit box, or the entire list is replaced
  21. >if the edited characters are deleted and a new starting character is typed.
  22. >
  23. >I'd like to understand what technique is used to present and control this
  24. >sort of query from the user.  Is it a combination of a single line edit control
  25. >and a list box or does some control exist that already implements this sort
  26. >of behavior?  
  27. >
  28. >Thanks for any thoughts.
  29. >
  30.  
  31. The standard combobox control is a combination of a single line edit
  32. control and a list box.
  33.  
  34. To get the behavior described above you have to do some work yourself.
  35. The edit control will send notifications to its parent window
  36. (WM_COMMAND:EN_CHANGE, & WM_COMMAND:EN_UPDATE) when a
  37. character is typed in.  If you trap that message you can search the listbox
  38. for the string that best matches what is currently in the edit control.
  39. You could do the same thing by subclassing the control and capturing the
  40. messages that way.  
  41.  
  42. I've done this before and its not that hard.  You might be able to find some
  43. example code around somewhere.
  44.  
  45. Tom Keane
  46. 75151,03563@compuserve.com
  47.  
  48.